-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(deps): update to React 19 #393
base: main
Are you sure you want to change the base?
Conversation
package.json
Outdated
], | ||
"overrides": { | ||
"react": "^19.0.0" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed since react-helmet-async
doesn't officially support React 19 yet. But it seems to work fine. I'm a little concerned that it's a dead project, but I'll probably submit a MR to it anyway.
@crgwbr : I love this, obviously, and want to move to React 19. But this is... pretty bold. Lot of things still not supporting React 19. Though it may be like react-helmet-async and they actually do just work fine. Once tests pass I'll give it a go with my main project. |
@silviogutierrez What would you think of getting rid of the helmet dependency entirely, in lieu of React 19's new metadata tag support? It'd involve some refactoring of how See https://react.dev/blog/2024/12/05/react-19#support-for-metadata-tags |
Not opposed at all, I just have no idea how the tags are injected in the server side part. Given the app shell is rendered outside of React. When 19 came out I scoured the docs and can't find a single reference. And yet it says it "works". |
For the life of me, I cannot find a single example of how meta tags are "hoisted" on the server render. And yet the docs mention this works with SSR. |
Maybe we have to move to this: https://react.dev/reference/react-dom/server/renderToReadableStream |
@silviogutierrez Just pushed some prototype code for you to look at—native meta tag hoisting seems to work if we generate the app shell via React, rather than using string templating. The client side app still only rehydrates the part of the app within |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working with my biggest project. Will do more testing and reviewing but leaving this here now. Great work!
"scripts": { | ||
"postinstall": "patch-package" | ||
}, | ||
"overrides": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we go rid of helmet, do we still need this?
Does it cascade down to consumer projects? If so, we do want that.
Ok good news and bad news. Turns out those quote issues are unrelated, so ignore them. I marked the comment as complete. Bad news: Try it, in your app just call This is due to our architecture change of rendering a full document on the server and just a root node on the client. Attached is a POC patch that fixes the issue, but it comes at significant cost. We now have hydration on the client include the shell. So the shell needs to be aware of a lot of reactivated internals that the library consumer was not bothered with. Note also in this crude approach we suppress some hydration stuff. But it's pretty gnarly. Options:
I'm going to let this marinate and welcome your thoughts. It does seem like React is very heavily encouraging full document handling, and all APIs are moving in that direction. So might be best to rip the bandaid. Related issues (notably, HMR still works with the fix): https://github.com/vercel/next.js/pull/31102/files |
Also I'm looking at this renderToPipeableStream Seems like there are some parameters there that could be related and are meant for these situations. Maybe hydration takes them into account. |
No description provided.